package org.webdb.webapp.jackson;

import java.util.Collection;

import org.codehaus.jackson.Version;
import org.codehaus.jackson.map.JsonSerializer;
import org.codehaus.jackson.map.ObjectMapper;
import org.codehaus.jackson.map.module.SimpleModule;

public class ConfigurableObjectMapper extends ObjectMapper {

    public ConfigurableObjectMapper(Collection<JsonSerializer<?>> serializers) {
        SimpleModule simpleModule = new SimpleModule("Webdb Jackson Module",
                new Version(1, 0, 0, null));
        for (JsonSerializer<?> serializer : serializers)
            simpleModule.addSerializer(serializer);

        this.registerModule(simpleModule);
    }

}
